package spring.rabbitmq.onetoone;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class OneToOneMessageSender {

    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void send() {
        String context = "message "+ System.currentTimeMillis();
        System.out.println("Sender : " + context);
        rabbitTemplate.convertAndSend("message", context);
    }

}
